package com.demo.homework;

import java.util.ArrayList;
import java.util.Comparator;
import java.util.function.Predicate;

/**
 * @ClassName 作业Stream运算
 * @Description TODO
 * @Author tianqinglong
 * @Date 19:20 2022/7/11
 * @Version 1.0
 **/
public class 作业Stream运算 {
    public static void main(String[] args) {
        作业();
    }

    private static void 作业() {
        ArrayList<Book> books = new ArrayList<>();
        books.add(new Book(1,"西游记1",100));
        books.add(new Book(2,"西游记2",30));
        books.add(new Book(3,"西游记3",400));
        books.add(new Book(4,"西游记4",50));
        books.add(new Book(5,"西游记5",10));
        books.stream().filter(book -> book.getPrice()<150).sorted((o1, o2) -> o2.getBid()-o1.getBid()).forEach(System.out::println);
    }
}
